<?php
namespace App\Models;

/**
 * 奖金日志类
 */
class MBonusLog extends BaseModel
{
    public $table = "bonus_logs";

    /**
     * 记录一条奖金日志
     * @param $uid
     * @param $username
     * @param $name
     * @param $money_real
     * @param $money_tax
     * @param $money
     * @param $ndepth
     * @param $pdepth
     * @param string $intro
     * @return bool
     */
    public static function log($uid, $username, $name, $money_real, $money_tax, $money, $ndepth, $pdepth, $intro = "")
    {
        $log = new MBonusLog();
        $log->no = onlyNo();
        $log->uid = $uid;
        $log->username = $username;
        $log->name = $name;
        $log->money_real = $money_real;
        $log->money_tax = $money_tax;
        $log->money = $money;
        $log->ndepth = $ndepth;
        $log->pdepth = $pdepth;
        $log->intro = $intro;
        $log->time = time();
        return $log->save();
    }
}